/*
 * GastoForm.java
 *
 * Created on 12 de julio de 2008, 19:16
 */

package View;

import Model.Congreso;

import Reportes.*;
import Servicio.Proxy;
import com.birosoft.liquid.LiquidLookAndFeel;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;



/**
 *
 * @author  Gigin
 */
public class ReportesExcelForm extends javax.swing.JFrame {

    private Congreso mCongreso;
    private ECajaForm caja;
    private int iModo;
    private PpalForm ppal;
    
    /** Creates new form GastoForm */
    public ReportesExcelForm(String modo, Congreso cong) {
        mCongreso=cong;
        
        //super(parent, modal);
        try {
            UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");   
        } catch (Exception e) { }
          LiquidLookAndFeel.setStipples(false);
          LiquidLookAndFeel.setShowTableGrids(true);
          
        initComponents();
       this.cargarCongresos();
    }
    
    
public void setPpal(PpalForm p){
       this.ppal=p;
}
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jComboBox2 = new javax.swing.JComboBox();
        jComboBox3 = new javax.swing.JComboBox();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jComboBox4 = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jComboBoxCongres = new javax.swing.JComboBox();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jButton2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel3.setFont(new java.awt.Font("Monotype Corsiva", 1, 24)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(94, 148, 189));
        jLabel3.setText("ReportesExcel");
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 20, -1, -1));

        jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/logo_GTV4.gif"))); // NOI18N
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 0, -1, -1));

        jComboBox1.setFont(new java.awt.Font("Verdana", 0, 11));
        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "", "Caja", "Clientes", "Gastos", "Ventas", "Stock" }));
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 80, 260, -1));

        jComboBox2.setFont(new java.awt.Font("Verdana", 0, 11));
        jComboBox2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox2ActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 130, 260, -1));

        jComboBox3.setFont(new java.awt.Font("Verdana", 0, 11));
        jComboBox3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox3ActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 180, 260, -1));

        jTextField1.setFont(new java.awt.Font("Verdana", 0, 11));
        jTextField1.setEnabled(false);
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });
        getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 350, 90, -1));

        jTextField2.setFont(new java.awt.Font("Verdana", 0, 11));
        jTextField2.setEnabled(false);
        getContentPane().add(jTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 350, 90, -1));

        jButton1.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Excel_normal.gif"))); // NOI18N
        jButton1.setBorderPainted(false);
        jButton1.setContentAreaFilled(false);
        jButton1.setDefaultCapable(false);
        jButton1.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Excel_deshabilitado.gif"))); // NOI18N
        jButton1.setEnabled(false);
        jButton1.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Excel_presionado.gif"))); // NOI18N
        jButton1.setRequestFocusEnabled(false);
        jButton1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Excel_mouse.gif"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 400, 130, 20));

        jLabel1.setFont(new java.awt.Font("Verdana", 0, 11));
        jLabel1.setForeground(new java.awt.Color(94, 148, 139));
        jLabel1.setText("Fecha Inicial:");
        jLabel1.setEnabled(false);
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 320, -1, -1));

        jLabel2.setFont(new java.awt.Font("Verdana", 0, 11));
        jLabel2.setForeground(new java.awt.Color(94, 148, 139));
        jLabel2.setText("Fecha Final:");
        jLabel2.setEnabled(false);
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 320, -1, -1));

        jLabel5.setFont(new java.awt.Font("Verdana", 0, 11));
        jLabel5.setForeground(new java.awt.Color(94, 148, 139));
        jLabel5.setText("aaaa-mm-dd");
        jLabel5.setEnabled(false);
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 380, -1, -1));

        jLabel6.setFont(new java.awt.Font("Verdana", 0, 11));
        jLabel6.setForeground(new java.awt.Color(94, 148, 139));
        jLabel6.setText("aaaa-mm-dd");
        jLabel6.setEnabled(false);
        getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 380, -1, -1));

        jComboBox4.setFont(new java.awt.Font("Verdana", 0, 11));
        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccione...", "Un Congreso", "Fechas de Congresos", "Fechas del Item" }));
        jComboBox4.setEnabled(false);
        jComboBox4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox4ActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBox4, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 260, 180, -1));

        jLabel7.setFont(new java.awt.Font("Verdana", 1, 11));
        jLabel7.setForeground(new java.awt.Color(94, 148, 139));
        jLabel7.setText("Rango");
        jLabel7.setEnabled(false);
        getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 230, -1, -1));

        jTextField3.setFont(new java.awt.Font("Verdana", 0, 11));
        jTextField3.setEnabled(false);
        jTextField3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField3ActionPerformed(evt);
            }
        });
        getContentPane().add(jTextField3, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 350, 100, -1));

        jLabel8.setFont(new java.awt.Font("Verdana", 0, 11));
        jLabel8.setForeground(new java.awt.Color(94, 148, 139));
        jLabel8.setText("Nombre archivo:");
        jLabel8.setEnabled(false);
        getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 320, -1, -1));

        jComboBoxCongres.setFont(new java.awt.Font("Verdana", 0, 11));
        jComboBoxCongres.setEnabled(false);
        jComboBoxCongres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxCongresActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBoxCongres, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 350, 160, -1));

        buttonGroup1.add(jRadioButton1);
        jRadioButton1.setFont(new java.awt.Font("Verdana", 0, 11));
        jRadioButton1.setForeground(new java.awt.Color(94, 148, 196));
        jRadioButton1.setSelected(true);
        jRadioButton1.setText("Mes a mes");
        jRadioButton1.setEnabled(false);
        getContentPane().add(jRadioButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 410, -1, -1));

        buttonGroup1.add(jRadioButton2);
        jRadioButton2.setFont(new java.awt.Font("Verdana", 0, 11));
        jRadioButton2.setForeground(new java.awt.Color(94, 148, 196));
        jRadioButton2.setText("Día a día");
        jRadioButton2.setEnabled(false);
        getContentPane().add(jRadioButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 410, -1, -1));

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Volver_normal.gif"))); // NOI18N
        jButton2.setToolTipText("Volver a la pantalla principal");
        jButton2.setBorderPainted(false);
        jButton2.setContentAreaFilled(false);
        jButton2.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Volver_deshabilitado.gif"))); // NOI18N
        jButton2.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Volver_presionado.gif"))); // NOI18N
        jButton2.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/Botones/Volver_mouse.gif"))); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 480, 120, 20));

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
    habilitacion(false);
    String combo1=jComboBox1.getSelectedItem().toString();
    if (combo1.compareTo("Gastos")==0){
        jComboBox2.removeAllItems();
        jComboBox3.removeAllItems();
        jComboBox3.setEnabled(false);
        jComboBox2.addItem("");
        jComboBox2.addItem("Uno a Uno");
        jComboBox2.addItem("Por Tipo");
        jComboBox2.addItem("Por Tipo y Fecha");
        jComboBox2.addItem("Por Tipo y Congreso");
    }
    if (combo1.compareTo("Clientes")==0){
        jComboBox2.removeAllItems();
        jComboBox3.removeAllItems();        
        jComboBox3.setEnabled(false);
        jComboBox4.setSelectedIndex(0);
        jComboBox4.setEnabled(true);
        jLabel7.setEnabled(true);
    }
    if (combo1.compareTo("Ventas")==0){
        jComboBox2.removeAllItems();
        jComboBox3.removeAllItems();
         jComboBox3.setEnabled(false);
        jComboBox2.addItem("");
        jComboBox2.addItem("Por Fecha");
        jComboBox2.addItem("Por Congreso");
    }
    if (combo1.compareTo("Stock")==0){
        jComboBox2.removeAllItems();
        jComboBox3.removeAllItems();
        jComboBox3.setEnabled(false);
        jComboBox2.addItem("");
        jComboBox2.addItem("Repuesto");
        //jComboBox2.addItem("Excedente");
        jComboBox2.addItem("Fallados");
    }
    if (combo1.compareTo("Caja")==0){
        jComboBox2.removeAllItems();
        jComboBox3.removeAllItems();
        jComboBox3.setEnabled(false);
        jComboBox2.addItem("");
       // jComboBox2.addItem("Por Fecha");
        jComboBox2.addItem("Por Congreso");
    }
    
    
}//GEN-LAST:event_jComboBox1ActionPerformed

private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
     String combo1=jComboBox1.getSelectedItem().toString();
     String combo2;
     try{
         combo2=jComboBox2.getSelectedItem().toString();
     }catch(Exception e){combo2="";}
     
    if (combo1.compareTo("Gastos")==0){
           if (combo2.compareTo("")==0){
               habilitacion(false);
           }else{
              jComboBox4.setSelectedIndex(0);
              jComboBox4.setEnabled(true);
               jLabel7.setEnabled(true);
               
           }
    }
     
     if (combo1.compareTo("Clientes")==0){
            jComboBox4.setSelectedIndex(0);
            jComboBox4.setEnabled(true);
             jLabel7.setEnabled(true);
    }
     
     if (combo1.compareTo("Ventas")==0){
           if (combo2.compareTo("")==0){
               habilitacion(false);
           }else{
               jComboBox3.removeAllItems();
               jComboBox3.setEnabled(true);
               if (combo2.compareTo("Por Fecha")==0){
                  habilitacion(false);
                   jComboBox3.addItem("Ventas Totales");
                   jComboBox3.addItem("Ventas durante Congreso");
                   jComboBox3.addItem("Ventas Directas");
                   jComboBox3.addItem("Ventas Después");
               }
               if (combo2.compareTo("Por Congreso")==0){
                   habilitacion(false);
                   jComboBox3.addItem("Ventas Totales");
                   jComboBox3.addItem("Ventas durante Congreso");
                   jComboBox3.addItem("Ventas Directas");
                   jComboBox3.addItem("Ventas Después");
                   jComboBox3.addItem("Cantidad DVDs Durante");
                   jComboBox3.addItem("Cantidad DVDs Después");
               }
           }     
    }
     
     if (combo1.compareTo("Stock")==0){
           if (combo2.compareTo("")==0){
              habilitacion(false);
           }else{
              jComboBox4.setSelectedIndex(0);
              jComboBox4.setEnabled(true);
               jLabel7.setEnabled(true);
           }
    }
     
     if (combo1.compareTo("Caja")==0){
           if (combo2.compareTo("")==0){
               habilitacion(false);
           }else{
               jComboBox4.setSelectedIndex(0);
              jComboBox4.setEnabled(true);
               jLabel7.setEnabled(true);
           }
    }
}//GEN-LAST:event_jComboBox2ActionPerformed

private void habilitacion(boolean val){
    jLabel1.setEnabled(val);
    jLabel2.setEnabled(val);
    jLabel3.setEnabled(val);
    jLabel4.setEnabled(val);
    jLabel5.setEnabled(val);
    jLabel6.setEnabled(val);
    jLabel7.setEnabled(val);
    jTextField1.setEnabled(val);
    jTextField2.setEnabled(val);
    jTextField3.setEnabled(val);
    jComboBox4.setEnabled(val);
    jComboBoxCongres.setEnabled(val);
    jButton1.setEnabled(val);
    jRadioButton1.setEnabled(val);
    jRadioButton2.setEnabled(val);
}
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed

private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
this.jButton1ActionPerformed(evt);
}//GEN-LAST:event_jTextField3ActionPerformed

private void jComboBoxCongresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxCongresActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jComboBoxCongresActionPerformed

private void jComboBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3ActionPerformed

     String combo3,combo2;
     try{
         combo2=jComboBox2.getSelectedItem().toString();
         combo3=jComboBox3.getSelectedItem().toString();
     }catch(Exception e){combo3="";combo2="";}
     if (combo3.compareTo("")==0)
         habilitacion(false);
     else{
         
             jComboBox4.setSelectedIndex(0);
             jComboBox4.setEnabled(true);
             jLabel7.setEnabled(true);
             
     }
         
     
}//GEN-LAST:event_jComboBox3ActionPerformed

private void jComboBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox4ActionPerformed
 String combo2;
     try{
         combo2=jComboBox2.getSelectedItem().toString();
     }catch(Exception e){combo2="";}
int index=jComboBox4.getSelectedIndex();
if (index==0){
    habilitacion(false);
}else{
    habilitacion(false);
     jLabel7.setEnabled(true);
    jComboBox4.setEnabled(true);
     jLabel3.setEnabled(true);
     jLabel4.setEnabled(true);
     jLabel8.setEnabled(true);
     jTextField3.setEnabled(true);
     jButton1.setEnabled(true);
     if (index==1){
       this.jComboBoxCongres.setEnabled(true);
    }else{
         jTextField1.setEnabled(true);
         jTextField2.setEnabled(true);
         jLabel1.setEnabled(true);
         jLabel2.setEnabled(true);
         jLabel5.setEnabled(true);
         jLabel6.setEnabled(true);
    }   
     
     if (combo2.compareTo("Por Tipo y Fecha")==0){
                   jRadioButton1.setEnabled(true);
                   jRadioButton2.setEnabled(true);
               }
     if (combo2.compareTo("Por Fecha")==0){
                   jRadioButton1.setEnabled(true);
                   jRadioButton2.setEnabled(true);
               }
}

}//GEN-LAST:event_jComboBox4ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String name=jTextField3.getText();
ManejaExcel excel=null;
String combo1="",combo2="",combo3="";
int combo4=0;
String par1="";
String par2="";
int opc1=2;
String opc2="m";
try{
    combo4=jComboBox4.getSelectedIndex();
    combo1=jComboBox1.getSelectedItem().toString();
    combo2=jComboBox2.getSelectedItem().toString();
    combo3=jComboBox3.getSelectedItem().toString();
    
}catch(Exception e){}

if (jRadioButton2.isSelected()) opc2="d-%m";

switch(combo4){
    case 1: 
            opc1=1;
            Congreso c=(Congreso)jComboBoxCongres.getSelectedItem();
            par2=c.getFechaInicio();
            par1=c.getIniciales();
           // System.out.println(par1);System.out.println(par2);
            break;
    case 2:
            opc1=2;
            par1=jTextField1.getText();
            par2=jTextField2.getText();
            break;
   case 3:
            opc1=3;
            par1=jTextField1.getText();
            par2=jTextField2.getText();
            break;
}
   
    if (combo1.compareTo("Gastos")==0){
           if (combo2.compareTo("Uno a Uno")==0)
               excel=new rGastoDesc(name,par1,par2,opc1,opc2);
           if (combo2.compareTo("Por Tipo")==0)
               excel=new rGastoTipo(name,par1,par2,opc1,opc2);
           if (combo2.compareTo("Por Tipo y Fecha")==0)
               excel=new rGastoIpoFecha(name,par1,par2,opc1,opc2);
           if (combo2.compareTo("Por Tipo y Congreso")==0)
               excel=new rGastoTipoCong(name,par1,par2,opc1,opc2);
    }
     
     if (combo1.compareTo("Clientes")==0){
         if (opc1==3) 
             opc1=2;
          excel=new generaClientes(name,par1,par2,opc1,opc2); 
    }
     
     if (combo1.compareTo("Ventas")==0){
             if (combo2.compareTo("Por Fecha")==0){
                if (combo3.compareTo("Ventas Totales")==0)
                   excel=new xVentasXFechaTotal(name,par1,par2,opc1,opc2);
                if (combo3.compareTo("Ventas durante Congreso")==0)
                   excel=new xVentasXFechaDurPedidos(name,par1,par2,opc1,opc2);
                if (combo3.compareTo("Ventas Directas")==0)
                   excel=null;
                if (combo3.compareTo("Ventas Después")==0)
                   excel=new xVentasXFechaPostPedidos(name,par1,par2,opc1,opc2);
               }
               if (combo2.compareTo("Por Congreso")==0){
                   if (combo3.compareTo("Ventas Totales")==0)
                       excel=new rVentasXCongTotal(name,par1,par2,opc1,opc2);
                   if (combo3.compareTo("Ventas durante Congresos")==0)
                       excel=new rVentasXCongDurPedidos(name,par1,par2,opc1,opc2);
                   if (combo3.compareTo("Ventas Directas")==0)
                       excel=new rVentasXCongDirectas(name,par1,par2,opc1,opc2);
                   if (combo3.compareTo("Ventas Después")==0)
                       excel=new rVentasXCongPostPedidos(name,par1,par2,opc1,opc2);
                   if (combo3.compareTo("Cantidad DVDs Durante")==0)
                       excel=new rVentasXCongDurDVD(name,par1,par2,opc1,opc2);
                   if (combo3.compareTo("Cantidad DVDs Después")==0)
                       excel=new rVentasXCongPostDVD(name,par1,par2,opc1,opc2);

               }
    }
     
     if (combo1.compareTo("Stock")==0){
           if (combo2.compareTo("Repuesto")==0)
               excel=new rStockRepuestos(name,par1,par2,opc1,opc2); 
           if (combo2.compareTo("Excedente")==0)
               excel=null; 
           if (combo2.compareTo("Fallados")==0)
               excel=new rStockFallados(name,par1,par2,opc1,opc2); 
    }
     
     if (combo1.compareTo("Caja")==0){
           if (combo2.compareTo("Por Fecha")==0)
               excel=null; 
           if (combo2.compareTo("Por Congreso")==0)
               excel=new xCajaXCongreso(name,par1,par2,opc1,opc2);
    }        

if (name.compareTo("")==0)
     JOptionPane.showMessageDialog(new JFrame(), "Debe ingresar el nombre del archivo", " ", JOptionPane.INFORMATION_MESSAGE);
else{
    excel.generaReporte();
     JOptionPane.showMessageDialog(new JFrame(), "Se ha generado el informe el el directorio del sistema", " ", JOptionPane.INFORMATION_MESSAGE);//GEN-LAST:event_jButton1ActionPerformed
}
}                                        

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
ppal.cargarFormulario();
this.dispose();

    // TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed

private void cargarCongresos(){
    ArrayList<Congreso> cong=Proxy.obtenerCongresos();
    for (int i=0;i<cong.size();i++){
        jComboBoxCongres.addItem(cong.get(i));
    }
}

    /**
    * @param args the command line arguments
    */
/*    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                GastoForm dialog = new GastoForm(new javax.swing.JFrame(), true, new ECajaForm);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

  */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBoxCongres;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    // End of variables declaration//GEN-END:variables

}
